home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / Aidan's Class Libraries / Source / Layout Classes / GrowBox.cpp < prev    next >
Encoding:
Text File  |  1997-07-13  |  838 b   |  45 lines  |  [TEXT/CWIE]

  1. //Copyright (c) 1997 Aidan Cully
  2. //All rights reserved
  3.  
  4. #include "CLBaseWindow.h"
  5. #include "CLGrowBox.h"
  6.  
  7. TGrowBox::TGrowBox( TLayoutBranch *super ):
  8.     TWindowDrawer( super )
  9. {
  10. }
  11.  
  12. void TGrowBox::DrawWindowSelf( TBaseWindow *gr )
  13. {
  14.     WindowRef window= gr->GetWindow();
  15.     GrafPtr oldPort;
  16.     ::GetPort( &oldPort );
  17.     ::SetPort( window );
  18.     RgnHandle tRgn;
  19.     tRgn= ::NewRgn();
  20.     ::GetClip( tRgn );
  21.     ::ClipRect( &GetLocalRect() );
  22.     ::DrawGrowIcon( window );
  23.     ::SetClip( tRgn );
  24.     ::SetPort( oldPort );
  25.     ::DisposeRgn( tRgn );
  26. }
  27.  
  28. Rect TGrowBox::GetLargestSize()
  29. {
  30.     Rect ret;
  31.     ::SetRect( &ret, 0, 0, 16, 16 );
  32.     return( ret );
  33. }
  34.  
  35. Boolean TGrowBox::MakeActive( Boolean active )
  36. {
  37.     DrawWindow( mWindow );
  38.     return( true );
  39. }
  40.  
  41. void TGrowBox::HandleMouse( TMouseButtonEvent *ev )
  42. {
  43.     WindowRef win;
  44.     mWindow->DoMouseDown( ::FindWindow( ev->where, &win ), ev );
  45. }